float4x4 matViewProjection : ViewProjection;
float4x4 world;
struct VS_INPUT 
{
   float4 Position: POSITION0;
   float2 TexCoord: TEXCOORD0;
};

struct VS_OUTPUT 
{
   float4 Position: POSITION0;
   float2 TexCoord: TEXCOORD0;  
};

VS_OUTPUT vs_main( VS_INPUT Input )
{
   VS_OUTPUT Output;
   Output.Position = mul(Input.Position, world);
   Output.Position = mul( Output.Position, matViewProjection );
   Output.TexCoord = Input.TexCoord;

   return( Output ); 
}

struct PS_INPUT 
{
   float2 TexCoord: TEXCOORD0;
};

float4 ps_main( PS_INPUT Input ) : COLOR0
{
   //  Output constant color:
   float4 color = float4( 1.0f, 1.0f, 1.0f, 0.0f );
   //color.xy = Input.TexCoord;
   int black = (int) (Input.TexCoord.x * 20.0f);
   int white = (int) (Input.TexCoord.y * 20.0f);
   
   if (black % 2 == 0)
   {
      if (white % 2 == 1)
      {
         color = float4( 0.0f, 0.0f, 0.0f, 0.0f );
      }
      else
      {
         color = float4( 1.0f, 1.0f, 1.0f, 0.0f );
      }
      
   }
   if (black % 2 == 1)
   {
      if (white % 2 == 1)
      {
         color = float4( 1.0f, 1.0f, 1.0f, 0.0f );
      }
      else
      {
         color = float4( 0.0f, 0.0f, 0.0f, 0.0f );
      }
   }
   return( color );
}
//--------------------------------------------------------------//
// Technique Section for Show Texcoord
//--------------------------------------------------------------//
technique Show_Texcoord
{
   pass Pass_0
   {
      VertexShader = compile vs_2_0 vs_main();
      PixelShader = compile ps_2_0 ps_main();
   }
}
